/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model.entity;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author lnngu_000
 */
@Entity
@Table(name = "Restaurant")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Restaurant.findAll", query = "SELECT r FROM Restaurant r"),
    @NamedQuery(name = "Restaurant.findByRestaurantId", query = "SELECT r FROM Restaurant r WHERE r.restaurantId = :restaurantId"),
    @NamedQuery(name = "Restaurant.findByIsVegetarian", query = "SELECT r FROM Restaurant r WHERE r.isVegetarian = :isVegetarian"),
    @NamedQuery(name = "Restaurant.findByIsNonVeg", query = "SELECT r FROM Restaurant r WHERE r.isNonVeg = :isNonVeg"),
    @NamedQuery(name = "Restaurant.findByRegional", query = "SELECT r FROM Restaurant r WHERE r.regional = :regional"),
    @NamedQuery(name = "Restaurant.findByProvinces", query = "SELECT r FROM Restaurant r WHERE r.provinces = :provinces"),
    @NamedQuery(name = "Restaurant.findByLocation", query = "SELECT r FROM Restaurant r WHERE r.location = :location"),
    @NamedQuery(name = "Restaurant.findByNumberOfPlates", query = "SELECT r FROM Restaurant r WHERE r.numberOfPlates = :numberOfPlates"),
    @NamedQuery(name = "Restaurant.findByExperience", query = "SELECT r FROM Restaurant r WHERE r.experience = :experience"),
    @NamedQuery(name = "Restaurant.findByIsActive", query = "SELECT r FROM Restaurant r WHERE r.isActive = :isActive"),
    @NamedQuery(name = "Restaurant.findByDescriptions", query = "SELECT r FROM Restaurant r WHERE r.descriptions = :descriptions")})
public class Restaurant implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @GeneratedValue(strategy= GenerationType.IDENTITY)
    @Column(name = "restaurantId")
    private Integer restaurantId;
    @Column(name = "isVegetarian")
    private Boolean isVegetarian;
    @Column(name = "isNonVeg")
    private Boolean isNonVeg;
    @Size(max = 200)
    @Column(name = "regional")
    private String regional;
    @Size(max = 100)
    @Column(name = "provinces")
    private String provinces;
    @Size(max = 200)
    @Column(name = "location")
    private String location;
    @Size(max = 100)
    @Column(name = "numberOfPlates")
    private String numberOfPlates;
    @Column(name = "experience")
    private Integer experience;
    @Column(name = "isActive")
    private Boolean isActive;
    @Size(max = 2147483647)
    @Column(name = "descriptions")
    private String descriptions;
    @Size(max = 2147483647)
    @Column(name = "dish")
    private String dish;
    @Size(max = 100)
    @Column(name = "openTime")
    private String openTime;
    @Size(max = 100)
    @Column(name = "closeTime")
    private String closeTime;
    
    @Size(max = 2147483647)
    @Column(name = "imageUrl")
    private String imageUrl;
    
    @Size(max = 500)
    @Column(name = "name")
    private String name;
    
    @Size(max = 2147483647)
    @Column(name = "address")
    private String address;
    
    @OneToMany(mappedBy = "restaurantId")
    private Collection<Items> itemsCollection;
    @JoinColumn(name = "catererId", referencedColumnName = "catererId")
    @ManyToOne
    private Caterer catererId;
    @OneToMany(mappedBy = "restaurantId")
    private Collection<Orders> ordersCollection;
    @OneToMany(mappedBy = "restaurantId")
    private Collection<PaymentMethod> paymentMethodCollection;

    public Restaurant() {
    }

    public Restaurant(Integer restaurantId) {
        this.restaurantId = restaurantId;
    }

    public Integer getRestaurantId() {
        return restaurantId;
    }

    public void setRestaurantId(Integer restaurantId) {
        this.restaurantId = restaurantId;
    }

    public Boolean getIsVegetarian() {
        return isVegetarian;
    }

    public void setIsVegetarian(Boolean isVegetarian) {
        this.isVegetarian = isVegetarian;
    }

    public Boolean getIsNonVeg() {
        return isNonVeg;
    }

    public void setIsNonVeg(Boolean isNonVeg) {
        this.isNonVeg = isNonVeg;
    }

    public String getRegional() {
        return regional;
    }

    public void setRegional(String regional) {
        this.regional = regional;
    }

    public String getProvinces() {
        return provinces;
    }

    public void setProvinces(String provinces) {
        this.provinces = provinces;
    }

    public String getLocation() {
        return location;
    }

    public void setLocation(String location) {
        this.location = location;
    }

    public String getNumberOfPlates() {
        return numberOfPlates;
    }

    public void setNumberOfPlates(String numberOfPlates) {
        this.numberOfPlates = numberOfPlates;
    }

    public Integer getExperience() {
        return experience;
    }

    public void setExperience(Integer experience) {
        this.experience = experience;
    }

    public Boolean getIsActive() {
        return isActive;
    }

    public void setIsActive(Boolean isActive) {
        this.isActive = isActive;
    }

    public String getDescriptions() {
        return descriptions;
    }

    public void setDescriptions(String descriptions) {
        this.descriptions = descriptions;
    }

    public String getDish() {
        return dish;
    }

    public void setDish(String dish) {
        this.dish = dish;
    }

    public String getOpenTime() {
        return openTime;
    }

    public void setOpenTime(String openTime) {
        this.openTime = openTime;
    }

    public String getCloseTime() {
        return closeTime;
    }

    public void setCloseTime(String closeTime) {
        this.closeTime = closeTime;
    }

    public String getImageUrl() {
        return imageUrl;
    }

    public void setImageUrl(String imageUrl) {
        this.imageUrl = imageUrl;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }
    
    

    @XmlTransient
    public Collection<Items> getItemsCollection() {
        return itemsCollection;
    }

    public void setItemsCollection(Collection<Items> itemsCollection) {
        this.itemsCollection = itemsCollection;
    }

    public Caterer getCatererId() {
        return catererId;
    }

    public void setCatererId(Caterer catererId) {
        this.catererId = catererId;
    }

    @XmlTransient
    public Collection<Orders> getOrdersCollection() {
        return ordersCollection;
    }

    public void setOrdersCollection(Collection<Orders> ordersCollection) {
        this.ordersCollection = ordersCollection;
    }

    @XmlTransient
    public Collection<PaymentMethod> getPaymentMethodCollection() {
        return paymentMethodCollection;
    }

    public void setPaymentMethodCollection(Collection<PaymentMethod> paymentMethodCollection) {
        this.paymentMethodCollection = paymentMethodCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (restaurantId != null ? restaurantId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Restaurant)) {
            return false;
        }
        Restaurant other = (Restaurant) object;
        if ((this.restaurantId == null && other.restaurantId != null) || (this.restaurantId != null && !this.restaurantId.equals(other.restaurantId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "model.entity.Restaurant[ restaurantId=" + restaurantId + " ]";
    }
    
}
